﻿using System;
using System.Collections.Generic;

using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Web.Profile;

namespace WebSite.cn
{
    public partial class products_detfrm2 : System.Web.UI.Page
    {
        // Fields
             public string newsinfo = "";

        // Methods
        private void Bind()
        {
            DataTable table = SQLAccess.GreatDs("select DB_Pronew.newsid,DB_News.newsname,DB_News.typeid,DB_News.updatetime from DB_Pronew inner join DB_News on DB_News.newsid=DB_Pronew.newsid where DB_Pronew.proid=" + base.Request.QueryString["pid"].ToString() + " ").Tables[0];
            if (table.Rows.Count > 0)
            {
                foreach (DataRow row in table.Rows)
                {
                    string newsinfo = this.newsinfo;
                    this.newsinfo = newsinfo + "<li><a href='news_01.aspx?tid=" + row["typeid"].ToString() + "&nid=" + row["newsid"].ToString() + "' target='_parent'>" + row["newsname"].ToString() + "</a><span>" + string.Format("{0:d}", row["updatetime"]) + "</span></li>";
                }
            }
            else
            {
                this.newsinfo = "暂无相关文章!";
            }
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!base.IsPostBack && (base.Request.QueryString["pid"] != null))
            {
                this.Bind();
            }
        }


    }
}